<?php

// Import the layout from XML

if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER ['HTTP_X_REQUESTED_WITH']  == 'XMLHttpRequest') {
	require('../../../../wp-config.php');
	auth_redirect();
	
	canvas_import_layout($_POST['path_to_xml']);
	if($_POST["restore"] == 'true') echo 'Success! Now, <a href="javascript:window.location.reload()">reload your Canvas</a>.';
}
?>